package org.example.game.history;

/**
 * @Description: TODO
 * @Author wyatt
 * @Data 2024/05/12 23:17
 */
public class Solution1553 {

    public static void main(String[] args) {

        Solution1553 solution1553 = new Solution1553();
        solution1553.test();
        System.out.println(solution1553.minDays(10));
    }

    public void test(){
        for(int i=0;i<1000;i++){
            int first , second;

            first = i/2;
            second = 2 * (i/3);

            System.out.println( i + "," + first + "," + second);
        }
    }

    // 错误的解法， 不是要每天吃最多个
    public int minDays(int n) {

        int day = 0;
        int leave = n;
        int first , second;
        while (leave > 0){

            if(leave%2 == 0){
                first = leave/2;
            }else {
                first = 0;
            }

            if(leave%3 == 0){
                second = 2 * (leave/3);
            }else {
                second = 0;
            }
            System.out.println( leave + "," + first + "," + second);
            leave -= Math.max(Math.max(first, second), 1);
            day++;
        }

        return day;
    }

}
